<template>
  <div class="app-container">
    <!-- Header 区域 -->
    <CartHeader></CartHeader>

    <!-- 商品 Item 项组件 -->
    <cart-item  v-for="item in list" :key="item.id" :item="item"></cart-item>

    <!-- Foote 区域 -->
    <CartFooter></CartFooter>
  </div>
</template>

<script>
import {mapState,mapActions } from 'vuex'
import CartHeader from '@/cart/cart-header.vue'
import CartFooter from '@/cart/cart-footer.vue'
import CartItem from '@/cart/cart-item.vue'

export default {
  name: 'App',
  components: {
    CartHeader,
    CartFooter,
    CartItem
  },
  created(){
    this.setqing()
  },
  computed:{
    ...mapState('cart',['list'])
  },
  methods:{
    ...mapActions('cart',['setqing'])
  }
}
</script>

<style lang="less" scoped>
.app-container {
  padding: 50px 0;
  font-size: 14px;
}
</style>